/*
** Copyright (C) 2009 Joshua Brent Marsh <joshua@icub3d.com>
**  
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3 of the License, or
** (at your option) any later version.
**  
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**  
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**  
*/

/* $Id: test_helpers.c 9 2009-10-08 15:50:15Z joshua@icub3d.com $ */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <malloc.h>

void 
destroy_int (void *a)
{
  free (a);
}

int *
create_int (int x)
{
  int *ret;
  
  ret = malloc (sizeof (int));
  if (ret == NULL)
    {
      perror ("malloc_ret");
      return NULL;
    }

  *ret = x;

  return ret;
}

char * 
malloc_char (char c)
{
  char *ret;

  ret = malloc (sizeof (char));
  if (ret == NULL)
    return '\0';

  *ret = c;
  
  return ret;
}

